package day10;

import java.util.ArrayList;

public class phoneTest {
    public static void main(String[] args) {
        ArrayList<phone> list = new ArrayList<>();

        phone p1 = new phone("小米",1000);
        phone p2 = new phone("苹果",8999);
        phone p3 = new phone("锤子",2999);

        list.add(p1);
        list.add(p2);
        list.add(p3);

        ArrayList<phone> list1 = new ArrayList<>();
        list1 = find(list);

        for (int i = 0; i < list1.size(); i++) {
            System.out.println(list1.get(i).band+","+list1.get(i).price);
        }
    }
    public  static ArrayList<phone> find (ArrayList<phone> list){
        ArrayList<phone> list1 = new ArrayList<>();
        for (int i = 0; i < list.size(); i++) {
            if(list.get(i).price<3000) list1.add(list.get(i));
        }
        return list1;
    }


}
